<template>
  <div class="tabItem">
    <div
      class="tabItem-icon"
      :style="{ backgroundColor: config.bg }"
    >
      <img :src="config.icon" />
    </div>
    <div class="tabItem-content">
      <div class="tabItem-content-label">
        {{ config.label }}
      </div>
      <div class="tabItem-content-val">
        <div class="tabItem-content-val-num">
          {{ value }}
        </div>
        {{ config.unit }}
      </div>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    config: {
      type: Object
    },
    value: {
      type: [Number, String],
      default: 0
    }
  }
}
</script>
<style lang="scss">
.tabItem {
  width: 343px;
  height: 120px;
  background: url('~@/assets/img/overview/td-mid-bg.png')
    no-repeat;
  background-size: 100% 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  &-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: #497fa3;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 28px 0 48px;
    img {
      width: 34px;
      height: 34px;
    }
  }
  &-content {
    height: 70px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    &-label {
      font-size: 14px;
      line-height: 14px;
      font-weight: 500;
      color: #4c565c;
      margin-bottom: 20px;
    }
    &-val {
      display: flex;
      align-items: flex-end;
      justify-content: flex-start;
      font-size: 14px;
      line-height: 14px;
      font-weight: 500;
      color: #4c565c;
      &-num {
        font-size: 18px;
        line-height: 18px;
        font-family: DIN;
        font-weight: bold;
        color: #000000;
        margin: 0 5px -2px 0;
      }
    }
  }
}
</style>
